class Solution:
    def plusOne(self, digits: List[int]) -> List[int]:
        reverseList = digits[::-1]
        t = 1
        for i in range(len(reverseList)):
            sum = reverseList[i]+t
            reverseList[i] = sum%10
            t = sum//10
        if t:
            reverseList.append(t)
        return reverseList[::-1]